home *** CD-ROM | disk | FTP | other *** search
Wrap
CCCCFFFFIIIIRRRR2222DDDD((((3333SSSS)))) CCCCFFFFIIIIRRRR2222DDDD((((3333SSSS)))) NNNNAAAAMMMMEEEE CCCCFFFFIIIIRRRR2222DDDD, ZZZZFFFFIIIIRRRR2222DDDD, SSSSFFFFIIIIRRRR2222DDDD, DDDDFFFFIIIIRRRR2222DDDD - Compute the two-dimensional (2D) convolution of two 2D arrays SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS Single precision complex Fortran: CCCCAAAALLLLLLLL CCCCFFFFIIIIRRRR2222DDDD ((((_x,,,, _i_n_c_x,,,, _l_d_x,,,, _i_1_x_0,,,, _n_x_1,,,, _i_2_x_0,,,, _n_x_2,,,, _h,,,, _i_n_c_h,,,, _l_d_h,,,, _i_1_h_0,,,, _n_h_1,,,, _i_2_h_0,,,, _n_h_2,,,, _y,,,, _i_n_c_y,,,, _l_d_y,,,, _i_1_y_0,,,, _n_y_1,,,, _i_2_y_0,,,, _n_y_2,,,, _a_l_p_h_a,,,, _b_e_t_a)))) C/C++: ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>> vvvvooooiiiidddd ccccffffiiiirrrr2222dddd(((( ssssccccssssllll____ccccoooommmmpppplllleeeexxxx *_x,,,, iiiinnnntttt _i_n_c_x,,,, iiiinnnntttt _l_d_x,,,, iiiinnnntttt _i_1_x_0,,,, iiiinnnntttt _n_x_1,,,, iiiinnnntttt _i_2_x_0,,,, iiiinnnntttt _n_x_2,,,, ssssccccssssllll____ccccoooommmmpppplllleeeexxxx _h,,,, iiiinnnntttt _i_n_c_h,,,, iiiinnnntttt _l_d_h,,,, iiiinnnntttt _i_1_h_0,,,, iiiinnnntttt _n_h_1,,,, iiiinnnntttt _i_2_h_0,,,, iiiinnnntttt _n_h_2,,,, ssssccccssssllll____ccccoooommmmpppplllleeeexxxx _y,,,, iiiinnnntttt _i_n_c_y,,,, iiiinnnntttt _l_d_y,,,, iiiinnnntttt _i_1_y_0,,,, iiiinnnntttt _n_y_1,,,, iiiinnnntttt _i_2_y_0,,,, iiiinnnntttt _n_y_2,,,, ssssccccssssllll____ccccoooommmmpppplllleeeexxxx *_a_l_p_h_a,,,, ssssccccssssllll____ccccoooommmmpppplllleeeexxxx *_b_e_t_a))));;;; C++ STL: ####iiiinnnncccclllluuuuddddeeee <<<<ccccoooommmmpppplllleeeexxxx....hhhh>>>> ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>> vvvvooooiiiidddd ccccffffiiiirrrr2222dddd(((( ccccoooommmmpppplllleeeexxxx<<<<ffffllllooooaaaatttt>>>> *_x,,,, iiiinnnntttt _i_n_c_x,,,, iiiinnnntttt _1_d_x,,,, iiiinnnntttt _i_1_x_0,,,, iiiinnnntttt _n_x_1,,,, iiiinnnntttt _i_2_x_0,,,, iiiinnnntttt _n_x_2,,,, ccccoooommmmpppplllleeeexxxx<<<<ffffllllooooaaaatttt>>>> _h,,,, iiiinnnntttt _i_n_c_h,,,, iiiinnnntttt _l_d_h,,,, iiiinnnntttt _i_1_h_0,,,, iiiinnnntttt _n_h_1,,,, iiiinnnntttt _i_2_h_0,,,, iiiinnnntttt _n_h_2,,,, ccccoooommmmpppplllleeeexxxx<<<<ffffllllooooaaaatttt>>>> _y,,,, iiiinnnntttt _i_n_c_y,,,, iiiinnnntttt _l_d_y,,,, iiiinnnntttt _i_1_y_0,,,, iiiinnnntttt _n_y_1,,,, iiiinnnntttt _i_2_y_0,,,, ccccoooommmmpppplllleeeexxxx<<<<ffffllllooooaaaatttt>>>> *_a_l_p_h_a,,,, ccccoooommmmpppplllleeeexxxx<<<<ffffllllooooaaaatttt>>>> *_b_e_t_a))));;;; Double precision complex Fortran: CCCCAAAALLLLLLLL ZZZZFFFFIIIIRRRR2222DDDD ((((_x,,,, _i_n_c_x,,,, _l_d_x,,,, _i_1_x_0,,,, _n_x_1,,,, _i_2_x_0,,,, _n_x_2,,,, _h,,,, _i_n_c_h,,,, _l_d_h,,,, _i_1_h_0,,,, _n_h_1,,,, _i_2_h_0,,,, _n_h_2,,,, _y,,,, _i_n_c_y,,,, _l_d_y,,,, _i_1_y_0,,,, _n_y_1,,,, _i_2_y_0,,,, _n_y_2,,,, _a_l_p_h_a,,,, _b_e_t_a)))) C/C++: ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>> vvvvooooiiiidddd ccccffffiiiirrrr2222dddd(((( ssssccccssssllll____zzzzoooommmmpppplllleeeexxxx *_x,,,, iiiinnnntttt _i_n_c_x,,,, iiiinnnntttt _l_d_x,,,, iiiinnnntttt _i_1_x_0,,,, iiiinnnntttt _n_x_1,,,, iiiinnnntttt _i_2_x_0,,,, iiiinnnntttt _n_x_2,,,, ssssccccssssllll____zzzzoooommmmpppplllleeeexxxx _h,,,, iiiinnnntttt _i_n_c_h,,,, iiiinnnntttt _l_d_h,,,, iiiinnnntttt _i_1_h_0,,,, iiiinnnntttt _n_h_1,,,, iiiinnnntttt _i_2_h_0,,,, iiiinnnntttt _n_h_2,,,, ssssccccssssllll____zzzzoooommmmpppplllleeeexxxx _y,,,, iiiinnnntttt _i_n_c_y,,,, iiiinnnntttt _l_d_y,,,, iiiinnnntttt _i_1_y_0,,,, iiiinnnntttt _n_y_1,,,, iiiinnnntttt _i_2_y_0,,,, ssssccccssssllll____zzzzoooommmmpppplllleeeexxxx *_a_l_p_h_a,,,, ssssccccssssllll____zzzzoooommmmpppplllleeeexxxx *_b_e_t_a))));;;; C++ STL: ####iiiinnnncccclllluuuuddddeeee <<<<ccccoooommmmpppplllleeeexxxx....hhhh>>>> ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>> vvvvooooiiiidddd ccccffffiiiirrrr2222dddd(((( ccccoooommmmpppplllleeeexxxx<<<<ddddoooouuuubbbblllleeee>>>> *_x,,,, iiiinnnntttt _i_n_c_x,,,, iiiinnnntttt _l_d_x,,,, iiiinnnntttt _i_1_x_0,,,, iiiinnnntttt _n_x_1,,,, iiiinnnntttt _i_2_x_0,,,, iiiinnnntttt _n_x_2,,,, ccccoooommmmpppplllleeeexxxx<<<<ddddoooouuuubbbblllleeee>>>> _h,,,, iiiinnnntttt _i_n_c_h,,,, iiiinnnntttt _l_d_h,,,, iiiinnnntttt _i_1_h_0,,,, iiiinnnntttt _n_h_1,,,, iiiinnnntttt _i_2_h_0,,,, iiiinnnntttt _n_h_2,,,, ccccoooommmmpppplllleeeexxxx<<<<ddddoooouuuubbbblllleeee>>>> _y,,,, iiiinnnntttt _i_n_c_y,,,, iiiinnnntttt _l_d_y,,,, iiiinnnntttt _i_1_y_0,,,, iiiinnnntttt _n_y_1,,,, iiiinnnntttt _i_2_y_0,,,, ccccoooommmmpppplllleeeexxxx<<<<ddddoooouuuubbbblllleeee>>>> *_a_l_p_h_a,,,, ccccoooommmmpppplllleeeexxxx<<<<ddddoooouuuubbbblllleeee>>>> *_b_e_t_a))));;;; PPPPaaaaggggeeee 1111 CCCCFFFFIIIIRRRR2222DDDD((((3333SSSS)))) CCCCFFFFIIIIRRRR2222DDDD((((3333SSSS)))) Single precision Fortran: CCCCAAAALLLLLLLL SSSSFFFFIIIIRRRR2222DDDD ((((_x,,,, _i_n_c_x,,,, _l_d_x,,,, _i_1_x_0,,,, _n_x_1,,,, _i_2_x_0,,,, _n_x_2,,,, _h,,,, _i_n_c_h,,,, _l_d_h,,,, _i_1_h_0,,,, _n_h_1,,,, _i_2_h_0,,,, _n_h_2,,,, _y,,,, _i_n_c_y,,,, _l_d_y,,,, _i_1_y_0,,,, _n_y_1,,,, _i_2_y_0,,,, _n_y_2,,,, _a_l_p_h_a,,,, _b_e_t_a)))) C/C++: ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>> vvvvooooiiiidddd ssssffffiiiirrrr2222dddd(((( ffffllllooooaaaatttt *_x,,,, iiiinnnntttt _i_n_c_x,,,, iiiinnnntttt _l_d_x,,,, iiiinnnntttt _i_1_x_0,,,, iiiinnnntttt _n_x_1,,,, iiiinnnntttt _i_2_x_0,,,, iiiinnnntttt _n_x_2,,,, ffffllllooooaaaatttt _h,,,, iiiinnnntttt _i_n_c_h,,,, iiiinnnntttt _l_d_h,,,, iiiinnnntttt _i_1_h_0,,,, iiiinnnntttt _n_h_1,,,, iiiinnnntttt _i_2_h_0,,,, iiiinnnntttt _n_h_2,,,, ffffllllooooaaaatttt _y,,,, iiiinnnntttt _i_n_c_y,,,, iiiinnnntttt _l_d_y,,,, iiiinnnntttt _i_1_y_0,,,, iiiinnnntttt _n_y_1,,,, iiiinnnntttt _i_2_y_0,,,, ffffllllooooaaaatttt _a_l_p_h_a,,,, ffffllllooooaaaatttt _b_e_t_a))));;;; Double precision Fortran: CCCCAAAALLLLLLLL DDDDFFFFIIIIRRRR2222DDDD ((((_x,,,, _i_n_c_x,,,, _l_d_x,,,, _i_1_x_0,,,, _n_x_1,,,, _i_2_x_0,,,, _n_x_2,,,, _h,,,, _i_n_c_h,,,, _l_d_h,,,, _i_1_h_0,,,, _n_h_1,,,, _i_2_h_0,,,, _n_h_2,,,, _y,,,, _i_n_c_y,,,, _l_d_y,,,, _i_1_y_0,,,, _n_y_1,,,, _i_2_y_0,,,, _n_y_2,,,, _a_l_p_h_a,,,, _b_e_t_a)))) C/C++: ####iiiinnnncccclllluuuuddddeeee <<<<ccccoooommmmpppplllleeeexxxx....hhhh>>>> ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>> vvvvooooiiiidddd ddddffffiiiirrrr2222dddd(((( ddddoooouuuubbbblllleeee *_x,,,, iiiinnnntttt _i_n_c_x,,,, iiiinnnntttt _l_d_x,,,, iiiinnnntttt _i_1_x_0,,,, iiiinnnntttt _n_x_1,,,, iiiinnnntttt _i_2_x_0,,,, iiiinnnntttt _n_x_2,,,, ddddoooouuuubbbblllleeee _h,,,, iiiinnnntttt _i_n_c_h,,,, iiiinnnntttt _l_d_h,,,, iiiinnnntttt _i_1_h_0,,,, iiiinnnntttt _n_h_1,,,, iiiinnnntttt _i_2_h_0,,,, iiiinnnntttt _n_h_2,,,, ddddoooouuuubbbblllleeee _y,,,, iiiinnnntttt _i_n_c_y,,,, iiiinnnntttt _l_d_y,,,, iiiinnnntttt _i_1_y_0,,,, iiiinnnntttt _n_y_1,,,, iiiinnnntttt _i_2_y_0,,,, ddddoooouuuubbbblllleeee _a_l_p_h_a,,,, ddddoooouuuubbbblllleeee _b_e_t_a))));;;; IIIIMMMMPPPPLLLLEEEEMMMMEEEENNNNTTTTAAAATTTTIIIIOOOONNNN These routines are part of the SCSL Scientific Library and can be loaded using either the ----llllssssccccssss or the ----llllssssccccssss____mmmmpppp option. The ----llllssssccccssss____mmmmpppp option directs the linker to use the multi-processor version of the library. When linking to SCSL with ----llllssssccccssss or ----llllssssccccssss____mmmmpppp, the default integer size is 4 bytes (32 bits). Another version of SCSL is available in which integers are 8 bytes (64 bits). This version allows the user access to larger memory sizes and helps when porting legacy Cray codes. It can be loaded by using the ----llllssssccccssss____iiii8888 option or the ----llllssssccccssss____iiii8888____mmmmpppp option. A program may use only one of the two versions; 4-byte integer and 8-byte integer library calls cannot be mixed. The C and C++ prototypes shown above are appropriate for the 4-byte integer version of SCSL. When using the 8-byte integer version, the variables of type iiiinnnntttt become lllloooonnnngggg lllloooonnnngggg and the <<<<ssssccccssssllll____fffffffftttt____iiii8888....hhhh>>>> header file should be included. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN These routines compute the convolution of a 2D filter array _h with the 2D array _x, producing the output 2D array _y: PPPPaaaaggggeeee 2222 CCCCFFFFIIIIRRRR2222DDDD((((3333SSSS)))) CCCCFFFFIIIIRRRR2222DDDD((((3333SSSS)))) _y = beta * _y + alpha * _h * _x Let the following be the filter and data matrices: _H = _h_i, _j 0 <=_i <=_n_h_1, 1<= _j <=_n_h_2 _X = _x_i, _j 0<= _i <=_n_x_1, 1 <=_j < _n_x_2 The convolution operation is defined as: Y(i,j) = Sum Sum H(k,l) * x(i+k, j+l) k l The matrix _Y has values defined for 0<= _i<(nx1+nh1-1) and 0 <= j < (nx2 + nh2 - 1). In the ****FFFFIIIIRRRR2222DDDD routines, the number of terms in the output array is specified by the arguments _n_y_1 and _n_y_2. If _n_y_1 < (_n_x_1 + _n_h_1 - 1) or _n_y_2 < (_n_x_2 + _n_h_2 - 1), the output array y is truncated. If _n_y_1 < (_n_x_1 + _n_h_1 - 1) or _n_y_2 < (_n_x_2 + _n_h_2 - 1), the terms beyond _i = (_n_x_1 + _n_h_1 - 2) and _j = (_n_x_2 + _n_h_2 - 2) are set to 0. Generally, the arrays _x, _h and _y represent signals sampled at equal intervals in two dimensions, and the indexes of the arrays denote the samples. If all three signals are aligned, we may, without loss of generality, set the initial samples to 0 in both dimensions, as in the formulas above. The ****FFFFIIIIRRRR2222DDDD routines, however, permit more generality than this. The signals may be shifted from each other using input parameters specifiying the initial samples in each dimension. This can be useful in several situations. For example, if the input array has leading zero values that one does not wish to store, iiii1111xxxx0000 and iiii2222xxxx0000 may be set to the sample corresponding to the first non-zero element in the input array, and previous samples are treated as 0. Another use is to limit the output to just the "fully engaged" terms of the convolution. When nx1 >= _n_h_1 and _n_x_2 >= _n_h_2, the convolution defined above has ramp-up and ramp-down regions in which fewer than all _n_h_1*_n_h_2 filter values contribute to the output value, YYYY((((iiii,,,,jjjj)))). Setting iiii1111yyyy0000 to _n_h_1-1 and iiii2222yyyy0000 to _n_h_2-1 causes the first value output to correspond to sample (_n_h_1-1, _n_h_2- 1), thus skipping the ramp up region. Setting _n_y_1 to _n_x_1-_n_h_1+1 and _n_y_2 to _n_x_2-_n_h_2+1 then drops the ramp-down terms, limiting the output to just the fully engaged part. Note that, instead of (0,0), the initial sample could just as easily have been labeled (1,1) or (10,1) or (0,-78); the relevant point is that the first elements of each of the x, h and y arrays are defined to be the same sample as long as iiii1111xxxx0000 ==== iiii1111hhhh0000 ==== iiii1111yyyy0000 and iiii2222xxxx0000 ==== iiii2222hhhh0000 ==== iiii2222yyyy0000. PPPPaaaaggggeeee 3333 CCCCFFFFIIIIRRRR2222DDDD((((3333SSSS)))) CCCCFFFFIIIIRRRR2222DDDD((((3333SSSS)))) See the NOTES section of this man page for information about the interpretation of the data types described in the following arguments. These routines have the following arguments: _x Array of dimension (_l_d_x, _n_x_2). (input). CCCCFFFFIIIIRRRR2222DDDD: Single precision complex array. ZZZZFFFFIIIIRRRR2222DDDD: Double precision complex array. SSSSFFFFIIIIRRRRCCCC2222DDDD: Single precision array. DDDDFFFFIIIIRRRR2222DDDD: Double precision array. Input array containing the data to be convolved with _h. _i_n_c_x Integer. (input) Increment between two successive values of _x. _i_n_c_x must not be 0. _l_d_x Integer. (input) The number of rows in the _x array, as it was declared in the calling program (the leading dimension of _x). _l_d_x >= MAX (_n_x_1 * _i_n_c_x, 1) _i_1_x_0 Integer. (input) Sample corresponding to the first element of each column of _x. _n_x_1 Integer. (input) The number of elements in each column of _x. _n_x_1 >= 0. _i_2_x_0 Integer. (input). Sample corresponding to the first element of each row of _x. _n_x_2 Integer. (input). Number of elements in each row of _x. _n_x_2 >= 0. _h Array of dimension (_l_d_h, _n_h_2). (input). CCCCFFFFIIIIRRRR2222DDDD: Single precision complex array. ZZZZFFFFIIIIRRRR2222DDDD: Double precision complex array. SSSSFFFFIIIIRRRR2222DDDD: Single precision array. DDDDFFFFIIIIRRRR2222DDDD: Double precision array. Input array containing the filter matrix to be convolved with _x. _i_n_c_h Integer. (input) Increment between two successive values of _h. _i_n_c_h must not be 0. _l_d_h Integer. (input) The number of rows in the _h array, as it was declared in the calling program (the leading dimension of _h). _l_d_h >= MAX(_n_h_1 * _i_n_c_h, 1). PPPPaaaaggggeeee 4444 CCCCFFFFIIIIRRRR2222DDDD((((3333SSSS)))) CCCCFFFFIIIIRRRR2222DDDD((((3333SSSS)))) _i_1_h_0 Integer. (input) Sample corresponding to the first element of each column of _h. _n_h_1 Integer. (input) The number of elements in each column of _h. _n_h_1 >= 0. _i_2_h_0 Integer. (input) Sample corresponding to the first element of each row of _h. _n_h_2 Integer. (input) Specifies the number of elements in each row of _h. _n_h_2 >= 0. _y Array of dimension (_l_d_y, _n_y_2). (input and output) CCCCFFFFIIIIRRRR2222DDDD: Single precision complex array. ZZZZFFFFIIIIRRRR2222DDDD: Double precision complex array. SSSSFFFFIIIIRRRR2222DDDD: Single precision array. DDDDFFFFIIIIRRRR2222DDDD: Double precision array. Output of FIR filter. On entry the array _y must have been initialized, except when beta is zero. In that case, _y need not be initialized. On exit, the result overwrites _y. _i_n_c_y Integer. (input) Increment between two successive values of _y. _i_n_c_y must not be 0. _l_d_y Integer. (input) The number of rows in the _y array, as it was declared in the calling program (the leading dimension of _y). _l_d_y >= MAX( _n_y_1 * _i_n_c_y, 1). _i_1_y_0 Integer. (input) Sample corresponding to the first element of each column of _y. _n_y_1 Integer. (input) Number of elements in each column of _y. _n_y_1 >= 0. _i_2_y_0 Integer. (input) Index of the first element of each row of _y. _n_y_2 Integer. (input) Number of elements in each row of _y. _n_y_2 >= 0. _a_l_p_h_a Scale factor for the convolution. (input). CCCCFFFFIIIIRRRR2222DDDD: Single precision Complex. ZZZZFFFFIIIIRRRR2222DDDD: Double precision complex. SSSSFFFFIIIIRRRR2222DDDD: Single precision. DDDDFFFFIIIIRRRR2222DDDD: Double precision. For C/C++, a pointer to this value is passed. _b_e_t_a Scale factor for the output _y. (input) CCCCFFFFIIIIRRRR1111DDDD: Complex. ZZZZFFFFIIIIRRRR1111DDDD: Double complex. PPPPaaaaggggeeee 5555 CCCCFFFFIIIIRRRR2222DDDD((((3333SSSS)))) CCCCFFFFIIIIRRRR2222DDDD((((3333SSSS)))) SSSSFFFFIIIIRRRR1111DDDD: Real. DDDDFFFFIIIIRRRR1111DDDD: Double precision. When _b_e_t_a is zero, _y need not be set on input. For C/C++, a pointer to this value is passed. NNNNOOOOTTTTEEEESSSS The following data types are described in this documentation: TTTTeeeerrrrmmmm UUUUsssseeeedddd DDDDaaaattttaaaa ttttyyyyppppeeee Fortran: Array dimensioned 0000........_n----1111 xxxx((((0000::::nnnn----1111)))) Array of dimensions (_m,_n) xxxx((((mmmm,,,,nnnn)))) Array of dimensions (_m,_n,_p) xxxx((((mmmm,,,,nnnn,,,,pppp)))) IIIInnnntttteeeeggggeeeerrrr IIIINNNNTTTTEEEEGGGGEEEERRRR (IIIINNNNTTTTEEEEGGGGEEEERRRR****8888 for ----llllssssccccssss____iiii8888[[[[____mmmmpppp]]]]) Single precision RRRREEEEAAAALLLL Double precision DDDDOOOOUUUUBBBBLLLLEEEE PPPPRRRREEEECCCCIIIISSSSIIIIOOOONNNN Single precision complex CCCCOOOOMMMMPPPPLLLLEEEEXXXX Double precision complex DDDDOOOOUUUUBBBBLLLLEEEE CCCCOOOOMMMMPPPPLLLLEEEEXXXX C/C++: Array dimensioned 0000........_n----1111 xxxx[[[[_n]]]] Array of dimensions (_m,_n) xxxx[[[[mmmm****nnnn]]]] oooorrrr xxxx[[[[nnnn]]]][[[[mmmm]]]] Array of dimensions (_m,_n,_p) xxxx[[[[mmmm****nnnn****pppp]]]] oooorrrr xxxx[[[[pppp]]]][[[[nnnn]]]][[[[mmmm]]]] IIIInnnntttteeeeggggeeeerrrr iiiinnnntttt (lllloooonnnngggg lllloooonnnngggg for ----llllssssccccssss____iiii8888[[[[____mmmmpppp]]]]) Single precision ffffllllooooaaaatttt Double precision ddddoooouuuubbbblllleeee Single precision complex ssssccccssssllll____ccccoooommmmpppplllleeeexxxx Double precision complex ssssccccssssllll____zzzzoooommmmpppplllleeeexxxx C++ STL: Array dimensioned 0000........_n----1111 xxxx[[[[_n]]]] PPPPaaaaggggeeee 6666 CCCCFFFFIIIIRRRR2222DDDD((((3333SSSS)))) CCCCFFFFIIIIRRRR2222DDDD((((3333SSSS)))) Array of dimensions (_m,_n) xxxx[[[[mmmm****nnnn]]]] oooorrrr xxxx[[[[nnnn]]]][[[[mmmm]]]] Array of dimensions (_m,_n,_p) xxxx[[[[mmmm****nnnn****pppp]]]] oooorrrr xxxx[[[[pppp]]]][[[[nnnn]]]][[[[mmmm]]]] IIIInnnntttteeeeggggeeeerrrr iiiinnnntttt (lllloooonnnngggg lllloooonnnngggg for ----llllssssccccssss____iiii8888[[[[____mmmmpppp]]]]) Single precision ffffllllooooaaaatttt Double precision ddddoooouuuubbbblllleeee Single precision complex ccccoooommmmpppplllleeeexxxx<<<<ffffllllooooaaaatttt>>>> Double precision complex ccccoooommmmpppplllleeeexxxx<<<<ddddoooouuuubbbblllleeee>>>> CCCCAAAAUUUUTTTTIIIIOOOONNNNSSSS The arrays _x, _h and _y must be non-overlapping. EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS The following example computes the convolution of a 4x4-sample array _x with a filter _h containing 3x3 samples: Fortran: REAL X(0:3,0:3), H(0:2,0:2), Y(0:5,0:5) REAL ALPHA, BETA ALPHA = 1.0 BETA = 0.0 DO J = 0, 3 DO I = 0, 3 X(I,J) = -1.0 ENDDO ENDDO X(0,0) = 1.0 DO J = 0, 2 DO I = 0, 2 H(i,j) = 1.0/(i+j+1) ENDDO ENDDO CALL SFIR2D(X(0,0), 1, 4, 0, 4, 0, 4, & H(0,0), 1, 3, 0, 3, 0, 3, & Y(0,0), 1, 6, 0, 6, 0, 6, ALPHA, BETA) C/C++: #include <scsl_fft.h> float x[4][4], h[3][3], y[6][6]; float alpha = 1.0f; float beta = 0.0f; int i, j; PPPPaaaaggggeeee 7777 CCCCFFFFIIIIRRRR2222DDDD((((3333SSSS)))) CCCCFFFFIIIIRRRR2222DDDD((((3333SSSS)))) for (j=0; j<4; j++) { for (i=0; i<4; i++) { x[j][i] = -1.0f; } } x[0][0] = 1.0f; for (j=0; j<3; j++) { for (i=0; i<3; i++) { h[i] = 1.0f/(i+j+1); } } sfir2d((float *) x, 1, 4, 0, 4, 0, 4, (float *) h, 1, 3, 0, 3, 0, 3, (float *) y, 1, 6, 0, 6, 0, 6, alpha, beta); The output is Y(*,0) Y(*,1) Y(*,2) Y(*,3) Y(*,4) Y(*,5) Y(0,*) 1.0000 -0.5000 -1.1667 -1.8333 -0.8333 -0.3333 Y(1,*) -0.5000 -1.6667 -2.4167 -2.9167 -1.4167 -0.5833 Y(2,*) -1.1667 -2.4167 -3.3000 -3.7000 -1.8667 -0.7833 Y(3,*) -1.8333 -2.9167 -3.7000 -3.7000 -1.8667 -0.7833 Y(4,*) -0.8333 -1.4167 -1.8667 -1.8667 -1.0333 -0.4500 Y(5,*) -0.3333 -0.5833 -0.7833 -0.7833 -0.4500 -0.2000 Changing i1x0 to 1 produces the following shift in the output: Y(*,0) Y(*,1) Y(*,2) Y(*,3) Y(*,4) Y(*,5) Y(0,*) 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 Y(1,*) 1.0000 -0.5000 -1.1667 -1.8333 -0.8333 -0.3333 Y(2,*) -0.5000 -1.6667 -2.4167 -2.9167 -1.4167 -0.5833 Y(3,*) -1.1667 -2.4167 -3.3000 -3.7000 -1.8667 -0.7833 Y(4,*) -1.8333 -2.9167 -3.7000 -3.7000 -1.8667 -0.7833 Y(5,*) -0.8333 -1.4167 -1.8667 -1.8667 -1.0333 -0.4500 Changing i2h0 to -1 produces the following shift in the output: Y(*,0) Y(*,1) Y(*,2) Y(*,3) Y(*,4) Y(*,5) Y(0,*) -0.5000 -1.1667 -1.8333 -0.8333 -0.3333 0.0000 Y(1,*) -1.6667 -2.4167 -2.9167 -1.4167 -0.5833 0.0000 Y(2,*) -2.4167 -3.3000 -3.7000 -1.8667 -0.7833 0.0000 Y(3,*) -2.9167 -3.7000 -3.7000 -1.8667 -0.7833 0.0000 Y(4,*) -1.4167 -1.8667 -1.8667 -1.0333 -0.4500 0.0000 Y(5,*) -0.5833 -0.7833 -0.7833 -0.4500 -0.2000 0.0000 PPPPaaaaggggeeee 8888 CCCCFFFFIIIIRRRR2222DDDD((((3333SSSS)))) CCCCFFFFIIIIRRRR2222DDDD((((3333SSSS)))) Changing i1y0 to +1 and i2y0 to -1 produces the following shift in the output: Y(*,0) Y(*,1) Y(*,2) Y(*,3) Y(*,4) Y(*,5) Y(0,*) 0.0000 -0.5000 -1.6667 -2.4167 -2.9167 -1.4167 Y(1,*) 0.0000 -1.1667 -2.4167 -3.3000 -3.7000 -1.8667 Y(2,*) 0.0000 -1.8333 -2.9167 -3.7000 -3.7000 -1.8667 Y(3,*) 0.0000 -0.8333 -1.4167 -1.8667 -1.8667 -1.0333 Y(4,*) 0.0000 -0.3333 -0.5833 -0.7833 -0.7833 -0.4500 Y(5,*) 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 SSSSEEEEEEEE AAAALLLLSSSSOOOO CCCCFFFFIIIIRRRR1111DDDD(3S), CCCCFFFFIIIIRRRRMMMM1111DDDD(3S), IIIINNNNTTTTRRRROOOO____FFFFFFFFTTTT(3S), IIIINNNNTTTTRRRROOOO____SSSSCCCCSSSSLLLL(3S) PPPPaaaaggggeeee 9999